from django.db import models

# Create your models here.


class Interior(models.Model):
    interior_cod = models.CharField(max_length = 20,unique = True)
    def __str__(self):
        return self.interior_cod



class User(models.Model):
    userid = models.CharField(max_length = 20,unique = True)
    pswd = models.CharField(max_length = 20)
    encoding_text = models.CharField(max_length = 20,null = True,blank = True)
    pub_date = models.DateTimeField(auto_now = True)

    def __str__(self):
        return self.userid


class PaperName(models.Model):
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    subject = models.ForeignKey('paper.Subject', on_delete = models.CASCADE)
    paper_name_text = models.CharField(max_length = 200)

    def __str__(self):
        return self.paper_name_text
    



class Userdaan(models.Model):
    paper_name = models.ForeignKey(PaperName,on_delete=models.CASCADE)
    question_bank = models.CharField(max_length = 2000)
    question_amount = models.CharField(max_length = 200)
    question_score = models.CharField(max_length = 200)
    def __str__(self):
        return self.userti


class Student(models.Model):
    student_name = models.CharField(max_length = 50)
    student_age = models.CharField(max_length = 50)
    student_sex = models.CharField(max_length = 50)
    student_id = models.CharField(max_length = 100,unique = True)
    student_cell = models.CharField(max_length = 100,unique = True)
    def __str__(self):
        return self.stydent_name



class Personal(models.Model):
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    paper_coding = models.CharField(max_length = 50,null = True,blank = True)
    screen_name = models.CharField(max_length = 50,null = True,blank = True)
    stimulate = models.CharField(max_length = 200,null = True,blank = True)
    obj = models.IntegerField(default = 0)
    def __str__(self):
        return self.paper_coding









